
function viewprod(domain,pid,title,img,price,number){
	var newpro=domain+'___'+pid+'___'+title+'___'+img+'___'+price+'___'+number;
	var newpros = newpro + "---";
	var oldpros = $.cookie('viewhistory');
	//alert(oldpros);
	//循环判断该产品是否已经存在，不存在就添加
	if(oldpros && oldpros!=""){
		var pros = oldpros.split("---");
		for(i=0;i<pros.length-1;i++){
			var eachpids=pros[i].split("___");			
			if(eachpids[1]!=pid){
				newpros = newpros + pros[i] + "---";
			}
		}
		
	}
	//30天内有效
	$.cookie('viewhistory',newpros,{expires:30 , path : '/'});
	return;
}


function gotoPage(page,size,url)
{
	var pn = $("#btnpn").val();
	if(pn==''||isNaN(pn))
	{
	   alert("请输入页号");
	   return ;
	}
	var ipn = parseInt(pn);
	if(ipn<1||ipn>page)
	{
		alert("超出页数范围了");
		return;
	}
	var start = (parseInt(pn)-1)*size;
	document.location = url+start+".html";
}